package com.chaos.system.api.enums;

import lombok.Getter;

/**
 * @author Jacky
 * @date 2020/2/14 20:16
 */
@Getter
public enum SmsType {


    FORGET_PASSWORD(1, 10000, "忘记密码"),
    PHONE_LOGIN(2, 10001, "手机登录");

    private Integer code;
    private Integer templateId;
    private String msg;

    SmsType(Integer code, Integer templateId, String msg) {
        this.code = code;
        this.msg = msg;
        this.templateId = templateId;
    }

    public static SmsType getByCode(Integer code) {
        for (SmsType value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
